package registnet.dao;


import java.math.BigDecimal;
import java.sql.Connection;
import java.util.ArrayList;
import java.util.Date;
import java.util.Collections;
import java.util.List;

import org.apache.commons.lang.ObjectUtils;
import org.apache.torque.TorqueException;
import org.apache.torque.om.BaseObject;
import org.apache.torque.om.ComboKey;
import org.apache.torque.om.DateKey;
import org.apache.torque.om.NumberKey;
import org.apache.torque.om.ObjectKey;
import org.apache.torque.om.SimpleKey;
import org.apache.torque.om.StringKey;
import org.apache.torque.om.Persistent;
import org.apache.torque.util.Criteria;
import org.apache.torque.util.Transaction;


/**
 * This class was autogenerated by Torque on:
 *
 * [Tue Jun 30 14:38:16 PDT 2009]
 *
 * You should not use this class directly.  It should not even be
 * extended all references should be to CourseLog
 */
public abstract class BaseCourseLog extends BaseObject
{
    /** The Peer class */
    private static final CourseLogPeer peer =
        new CourseLogPeer();

        
    /** The value for the courseLogId field */
    private int courseLogId;
      
    /** The value for the action field */
    private int action;
      
    /** The value for the year field */
    private int year;
      
    /** The value for the month field */
    private int month;
      
    /** The value for the day field */
    private int day;
      
    /** The value for the hour field */
    private int hour;
      
    /** The value for the minute field */
    private String minute;
      
    /** The value for the second field */
    private String second;
      
    /** The value for the courseCode field */
    private String courseCode;
      
    /** The value for the courseName field */
    private String courseName;
      
    /** The value for the courseDescription field */
    private String courseDescription;
      
    /** The value for the units field */
    private int units;
                                          
    /** The value for the offered field */
    private int offered = 0;
      
    /** The value for the semesterOffered field */
    private String semesterOffered;
      
    /** The value for the prerequisite field */
    private String prerequisite;
      
    /** The value for the lectureHoursPerWeek field */
    private int lectureHoursPerWeek;
      
    /** The value for the minimumNumberOfLectureStudents field */
    private int minimumNumberOfLectureStudents;
      
    /** The value for the maximumNumberOfLectureStudents field */
    private int maximumNumberOfLectureStudents;
                                          
    /** The value for the hasLaboratory field */
    private int hasLaboratory = 1;
      
    /** The value for the laboratoryHoursPerWeek field */
    private int laboratoryHoursPerWeek;
      
    /** The value for the minimumNumberOfLaboratoryStudents field */
    private int minimumNumberOfLaboratoryStudents;
      
    /** The value for the maximumNumberOfLaboratoryStudents field */
    private int maximumNumberOfLaboratoryStudents;
      
    /** The value for the unitCode field */
    private String unitCode;
  
    
    /**
     * Get the CourseLogId
     *
     * @return int
     */
    public int getCourseLogId()
    {
        return courseLogId;
    }

                        
    /**
     * Set the value of CourseLogId
     *
     * @param v new value
     */
    public void setCourseLogId(int v) 
    {
    
                  if (this.courseLogId != v)
              {
            this.courseLogId = v;
            setModified(true);
        }
    
          
              }
  
    /**
     * Get the Action
     *
     * @return int
     */
    public int getAction()
    {
        return action;
    }

                        
    /**
     * Set the value of Action
     *
     * @param v new value
     */
    public void setAction(int v) 
    {
    
                  if (this.action != v)
              {
            this.action = v;
            setModified(true);
        }
    
          
              }
  
    /**
     * Get the Year
     *
     * @return int
     */
    public int getYear()
    {
        return year;
    }

                        
    /**
     * Set the value of Year
     *
     * @param v new value
     */
    public void setYear(int v) 
    {
    
                  if (this.year != v)
              {
            this.year = v;
            setModified(true);
        }
    
          
              }
  
    /**
     * Get the Month
     *
     * @return int
     */
    public int getMonth()
    {
        return month;
    }

                        
    /**
     * Set the value of Month
     *
     * @param v new value
     */
    public void setMonth(int v) 
    {
    
                  if (this.month != v)
              {
            this.month = v;
            setModified(true);
        }
    
          
              }
  
    /**
     * Get the Day
     *
     * @return int
     */
    public int getDay()
    {
        return day;
    }

                        
    /**
     * Set the value of Day
     *
     * @param v new value
     */
    public void setDay(int v) 
    {
    
                  if (this.day != v)
              {
            this.day = v;
            setModified(true);
        }
    
          
              }
  
    /**
     * Get the Hour
     *
     * @return int
     */
    public int getHour()
    {
        return hour;
    }

                        
    /**
     * Set the value of Hour
     *
     * @param v new value
     */
    public void setHour(int v) 
    {
    
                  if (this.hour != v)
              {
            this.hour = v;
            setModified(true);
        }
    
          
              }
  
    /**
     * Get the Minute
     *
     * @return String
     */
    public String getMinute()
    {
        return minute;
    }

                        
    /**
     * Set the value of Minute
     *
     * @param v new value
     */
    public void setMinute(String v) 
    {
    
                  if (!ObjectUtils.equals(this.minute, v))
              {
            this.minute = v;
            setModified(true);
        }
    
          
              }
  
    /**
     * Get the Second
     *
     * @return String
     */
    public String getSecond()
    {
        return second;
    }

                        
    /**
     * Set the value of Second
     *
     * @param v new value
     */
    public void setSecond(String v) 
    {
    
                  if (!ObjectUtils.equals(this.second, v))
              {
            this.second = v;
            setModified(true);
        }
    
          
              }
  
    /**
     * Get the CourseCode
     *
     * @return String
     */
    public String getCourseCode()
    {
        return courseCode;
    }

                        
    /**
     * Set the value of CourseCode
     *
     * @param v new value
     */
    public void setCourseCode(String v) 
    {
    
                  if (!ObjectUtils.equals(this.courseCode, v))
              {
            this.courseCode = v;
            setModified(true);
        }
    
          
              }
  
    /**
     * Get the CourseName
     *
     * @return String
     */
    public String getCourseName()
    {
        return courseName;
    }

                        
    /**
     * Set the value of CourseName
     *
     * @param v new value
     */
    public void setCourseName(String v) 
    {
    
                  if (!ObjectUtils.equals(this.courseName, v))
              {
            this.courseName = v;
            setModified(true);
        }
    
          
              }
  
    /**
     * Get the CourseDescription
     *
     * @return String
     */
    public String getCourseDescription()
    {
        return courseDescription;
    }

                        
    /**
     * Set the value of CourseDescription
     *
     * @param v new value
     */
    public void setCourseDescription(String v) 
    {
    
                  if (!ObjectUtils.equals(this.courseDescription, v))
              {
            this.courseDescription = v;
            setModified(true);
        }
    
          
              }
  
    /**
     * Get the Units
     *
     * @return int
     */
    public int getUnits()
    {
        return units;
    }

                        
    /**
     * Set the value of Units
     *
     * @param v new value
     */
    public void setUnits(int v) 
    {
    
                  if (this.units != v)
              {
            this.units = v;
            setModified(true);
        }
    
          
              }
  
    /**
     * Get the Offered
     *
     * @return int
     */
    public int getOffered()
    {
        return offered;
    }

                        
    /**
     * Set the value of Offered
     *
     * @param v new value
     */
    public void setOffered(int v) 
    {
    
                  if (this.offered != v)
              {
            this.offered = v;
            setModified(true);
        }
    
          
              }
  
    /**
     * Get the SemesterOffered
     *
     * @return String
     */
    public String getSemesterOffered()
    {
        return semesterOffered;
    }

                        
    /**
     * Set the value of SemesterOffered
     *
     * @param v new value
     */
    public void setSemesterOffered(String v) 
    {
    
                  if (!ObjectUtils.equals(this.semesterOffered, v))
              {
            this.semesterOffered = v;
            setModified(true);
        }
    
          
              }
  
    /**
     * Get the Prerequisite
     *
     * @return String
     */
    public String getPrerequisite()
    {
        return prerequisite;
    }

                        
    /**
     * Set the value of Prerequisite
     *
     * @param v new value
     */
    public void setPrerequisite(String v) 
    {
    
                  if (!ObjectUtils.equals(this.prerequisite, v))
              {
            this.prerequisite = v;
            setModified(true);
        }
    
          
              }
  
    /**
     * Get the LectureHoursPerWeek
     *
     * @return int
     */
    public int getLectureHoursPerWeek()
    {
        return lectureHoursPerWeek;
    }

                        
    /**
     * Set the value of LectureHoursPerWeek
     *
     * @param v new value
     */
    public void setLectureHoursPerWeek(int v) 
    {
    
                  if (this.lectureHoursPerWeek != v)
              {
            this.lectureHoursPerWeek = v;
            setModified(true);
        }
    
          
              }
  
    /**
     * Get the MinimumNumberOfLectureStudents
     *
     * @return int
     */
    public int getMinimumNumberOfLectureStudents()
    {
        return minimumNumberOfLectureStudents;
    }

                        
    /**
     * Set the value of MinimumNumberOfLectureStudents
     *
     * @param v new value
     */
    public void setMinimumNumberOfLectureStudents(int v) 
    {
    
                  if (this.minimumNumberOfLectureStudents != v)
              {
            this.minimumNumberOfLectureStudents = v;
            setModified(true);
        }
    
          
              }
  
    /**
     * Get the MaximumNumberOfLectureStudents
     *
     * @return int
     */
    public int getMaximumNumberOfLectureStudents()
    {
        return maximumNumberOfLectureStudents;
    }

                        
    /**
     * Set the value of MaximumNumberOfLectureStudents
     *
     * @param v new value
     */
    public void setMaximumNumberOfLectureStudents(int v) 
    {
    
                  if (this.maximumNumberOfLectureStudents != v)
              {
            this.maximumNumberOfLectureStudents = v;
            setModified(true);
        }
    
          
              }
  
    /**
     * Get the HasLaboratory
     *
     * @return int
     */
    public int getHasLaboratory()
    {
        return hasLaboratory;
    }

                        
    /**
     * Set the value of HasLaboratory
     *
     * @param v new value
     */
    public void setHasLaboratory(int v) 
    {
    
                  if (this.hasLaboratory != v)
              {
            this.hasLaboratory = v;
            setModified(true);
        }
    
          
              }
  
    /**
     * Get the LaboratoryHoursPerWeek
     *
     * @return int
     */
    public int getLaboratoryHoursPerWeek()
    {
        return laboratoryHoursPerWeek;
    }

                        
    /**
     * Set the value of LaboratoryHoursPerWeek
     *
     * @param v new value
     */
    public void setLaboratoryHoursPerWeek(int v) 
    {
    
                  if (this.laboratoryHoursPerWeek != v)
              {
            this.laboratoryHoursPerWeek = v;
            setModified(true);
        }
    
          
              }
  
    /**
     * Get the MinimumNumberOfLaboratoryStudents
     *
     * @return int
     */
    public int getMinimumNumberOfLaboratoryStudents()
    {
        return minimumNumberOfLaboratoryStudents;
    }

                        
    /**
     * Set the value of MinimumNumberOfLaboratoryStudents
     *
     * @param v new value
     */
    public void setMinimumNumberOfLaboratoryStudents(int v) 
    {
    
                  if (this.minimumNumberOfLaboratoryStudents != v)
              {
            this.minimumNumberOfLaboratoryStudents = v;
            setModified(true);
        }
    
          
              }
  
    /**
     * Get the MaximumNumberOfLaboratoryStudents
     *
     * @return int
     */
    public int getMaximumNumberOfLaboratoryStudents()
    {
        return maximumNumberOfLaboratoryStudents;
    }

                        
    /**
     * Set the value of MaximumNumberOfLaboratoryStudents
     *
     * @param v new value
     */
    public void setMaximumNumberOfLaboratoryStudents(int v) 
    {
    
                  if (this.maximumNumberOfLaboratoryStudents != v)
              {
            this.maximumNumberOfLaboratoryStudents = v;
            setModified(true);
        }
    
          
              }
  
    /**
     * Get the UnitCode
     *
     * @return String
     */
    public String getUnitCode()
    {
        return unitCode;
    }

                        
    /**
     * Set the value of UnitCode
     *
     * @param v new value
     */
    public void setUnitCode(String v) 
    {
    
                  if (!ObjectUtils.equals(this.unitCode, v))
              {
            this.unitCode = v;
            setModified(true);
        }
    
          
              }
  
         
                
    private static List fieldNames = null;

    /**
     * Generate a list of field names.
     *
     * @return a list of field names
     */
    public static synchronized List getFieldNames()
    {
        if (fieldNames == null)
        {
            fieldNames = new ArrayList();
              fieldNames.add("CourseLogId");
              fieldNames.add("Action");
              fieldNames.add("Year");
              fieldNames.add("Month");
              fieldNames.add("Day");
              fieldNames.add("Hour");
              fieldNames.add("Minute");
              fieldNames.add("Second");
              fieldNames.add("CourseCode");
              fieldNames.add("CourseName");
              fieldNames.add("CourseDescription");
              fieldNames.add("Units");
              fieldNames.add("Offered");
              fieldNames.add("SemesterOffered");
              fieldNames.add("Prerequisite");
              fieldNames.add("LectureHoursPerWeek");
              fieldNames.add("MinimumNumberOfLectureStudents");
              fieldNames.add("MaximumNumberOfLectureStudents");
              fieldNames.add("HasLaboratory");
              fieldNames.add("LaboratoryHoursPerWeek");
              fieldNames.add("MinimumNumberOfLaboratoryStudents");
              fieldNames.add("MaximumNumberOfLaboratoryStudents");
              fieldNames.add("UnitCode");
              fieldNames = Collections.unmodifiableList(fieldNames);
        }
        return fieldNames;
    }

    /**
     * Retrieves a field from the object by name passed in as a String.
     *
     * @param name field name
     * @return value
     */
    public Object getByName(String name)
    {
          if (name.equals("CourseLogId"))
        {
                return new Integer(getCourseLogId());
            }
          if (name.equals("Action"))
        {
                return new Integer(getAction());
            }
          if (name.equals("Year"))
        {
                return new Integer(getYear());
            }
          if (name.equals("Month"))
        {
                return new Integer(getMonth());
            }
          if (name.equals("Day"))
        {
                return new Integer(getDay());
            }
          if (name.equals("Hour"))
        {
                return new Integer(getHour());
            }
          if (name.equals("Minute"))
        {
                return getMinute();
            }
          if (name.equals("Second"))
        {
                return getSecond();
            }
          if (name.equals("CourseCode"))
        {
                return getCourseCode();
            }
          if (name.equals("CourseName"))
        {
                return getCourseName();
            }
          if (name.equals("CourseDescription"))
        {
                return getCourseDescription();
            }
          if (name.equals("Units"))
        {
                return new Integer(getUnits());
            }
          if (name.equals("Offered"))
        {
                return new Integer(getOffered());
            }
          if (name.equals("SemesterOffered"))
        {
                return getSemesterOffered();
            }
          if (name.equals("Prerequisite"))
        {
                return getPrerequisite();
            }
          if (name.equals("LectureHoursPerWeek"))
        {
                return new Integer(getLectureHoursPerWeek());
            }
          if (name.equals("MinimumNumberOfLectureStudents"))
        {
                return new Integer(getMinimumNumberOfLectureStudents());
            }
          if (name.equals("MaximumNumberOfLectureStudents"))
        {
                return new Integer(getMaximumNumberOfLectureStudents());
            }
          if (name.equals("HasLaboratory"))
        {
                return new Integer(getHasLaboratory());
            }
          if (name.equals("LaboratoryHoursPerWeek"))
        {
                return new Integer(getLaboratoryHoursPerWeek());
            }
          if (name.equals("MinimumNumberOfLaboratoryStudents"))
        {
                return new Integer(getMinimumNumberOfLaboratoryStudents());
            }
          if (name.equals("MaximumNumberOfLaboratoryStudents"))
        {
                return new Integer(getMaximumNumberOfLaboratoryStudents());
            }
          if (name.equals("UnitCode"))
        {
                return getUnitCode();
            }
          return null;
    }
    
    /**
     * Retrieves a field from the object by name passed in
     * as a String.  The String must be one of the static
     * Strings defined in this Class' Peer.
     *
     * @param name peer name
     * @return value
     */
    public Object getByPeerName(String name)
    {
          if (name.equals(CourseLogPeer.COURSELOGID))
        {
                return new Integer(getCourseLogId());
            }
          if (name.equals(CourseLogPeer.ACTION))
        {
                return new Integer(getAction());
            }
          if (name.equals(CourseLogPeer.YEAR))
        {
                return new Integer(getYear());
            }
          if (name.equals(CourseLogPeer.MONTH))
        {
                return new Integer(getMonth());
            }
          if (name.equals(CourseLogPeer.DAY))
        {
                return new Integer(getDay());
            }
          if (name.equals(CourseLogPeer.HOUR))
        {
                return new Integer(getHour());
            }
          if (name.equals(CourseLogPeer.MINUTE))
        {
                return getMinute();
            }
          if (name.equals(CourseLogPeer.SECOND))
        {
                return getSecond();
            }
          if (name.equals(CourseLogPeer.COURSECODE))
        {
                return getCourseCode();
            }
          if (name.equals(CourseLogPeer.COURSENAME))
        {
                return getCourseName();
            }
          if (name.equals(CourseLogPeer.COURSEDESCRIPTION))
        {
                return getCourseDescription();
            }
          if (name.equals(CourseLogPeer.UNITS))
        {
                return new Integer(getUnits());
            }
          if (name.equals(CourseLogPeer.OFFERED))
        {
                return new Integer(getOffered());
            }
          if (name.equals(CourseLogPeer.SEMESTEROFFERED))
        {
                return getSemesterOffered();
            }
          if (name.equals(CourseLogPeer.PREREQUISITE))
        {
                return getPrerequisite();
            }
          if (name.equals(CourseLogPeer.LECTUREHOURSPERWEEK))
        {
                return new Integer(getLectureHoursPerWeek());
            }
          if (name.equals(CourseLogPeer.MINIMUMNUMBEROFLECTURESTUDENTS))
        {
                return new Integer(getMinimumNumberOfLectureStudents());
            }
          if (name.equals(CourseLogPeer.MAXIMUMNUMBEROFLECTURESTUDENTS))
        {
                return new Integer(getMaximumNumberOfLectureStudents());
            }
          if (name.equals(CourseLogPeer.HASLABORATORY))
        {
                return new Integer(getHasLaboratory());
            }
          if (name.equals(CourseLogPeer.LABORATORYHOURSPERWEEK))
        {
                return new Integer(getLaboratoryHoursPerWeek());
            }
          if (name.equals(CourseLogPeer.MINIMUMNUMBEROFLABORATORYSTUDENTS))
        {
                return new Integer(getMinimumNumberOfLaboratoryStudents());
            }
          if (name.equals(CourseLogPeer.MAXIMUMNUMBEROFLABORATORYSTUDENTS))
        {
                return new Integer(getMaximumNumberOfLaboratoryStudents());
            }
          if (name.equals(CourseLogPeer.UNITCODE))
        {
                return getUnitCode();
            }
          return null;
    }

    /**
     * Retrieves a field from the object by Position as specified
     * in the xml schema.  Zero-based.
     *
     * @param pos position in xml schema
     * @return value
     */
    public Object getByPosition(int pos)
    {
            if (pos == 0)
        {
                return new Integer(getCourseLogId());
            }
              if (pos == 1)
        {
                return new Integer(getAction());
            }
              if (pos == 2)
        {
                return new Integer(getYear());
            }
              if (pos == 3)
        {
                return new Integer(getMonth());
            }
              if (pos == 4)
        {
                return new Integer(getDay());
            }
              if (pos == 5)
        {
                return new Integer(getHour());
            }
              if (pos == 6)
        {
                return getMinute();
            }
              if (pos == 7)
        {
                return getSecond();
            }
              if (pos == 8)
        {
                return getCourseCode();
            }
              if (pos == 9)
        {
                return getCourseName();
            }
              if (pos == 10)
        {
                return getCourseDescription();
            }
              if (pos == 11)
        {
                return new Integer(getUnits());
            }
              if (pos == 12)
        {
                return new Integer(getOffered());
            }
              if (pos == 13)
        {
                return getSemesterOffered();
            }
              if (pos == 14)
        {
                return getPrerequisite();
            }
              if (pos == 15)
        {
                return new Integer(getLectureHoursPerWeek());
            }
              if (pos == 16)
        {
                return new Integer(getMinimumNumberOfLectureStudents());
            }
              if (pos == 17)
        {
                return new Integer(getMaximumNumberOfLectureStudents());
            }
              if (pos == 18)
        {
                return new Integer(getHasLaboratory());
            }
              if (pos == 19)
        {
                return new Integer(getLaboratoryHoursPerWeek());
            }
              if (pos == 20)
        {
                return new Integer(getMinimumNumberOfLaboratoryStudents());
            }
              if (pos == 21)
        {
                return new Integer(getMaximumNumberOfLaboratoryStudents());
            }
              if (pos == 22)
        {
                return getUnitCode();
            }
              return null;
    }
     
    /**
     * Stores the object in the database.  If the object is new,
     * it inserts it; otherwise an update is performed.
     *
     * @throws Exception
     */
    public void save() throws Exception
    {
          save(CourseLogPeer.getMapBuilder()
                .getDatabaseMap().getName());
      }

    /**
     * Stores the object in the database.  If the object is new,
     * it inserts it; otherwise an update is performed.
       * Note: this code is here because the method body is
     * auto-generated conditionally and therefore needs to be
     * in this file instead of in the super class, BaseObject.
       *
     * @param dbName
     * @throws TorqueException
     */
    public void save(String dbName) throws TorqueException
    {
        Connection con = null;
          try
        {
            con = Transaction.begin(dbName);
            save(con);
            Transaction.commit(con);
        }
        catch(TorqueException e)
        {
            Transaction.safeRollback(con);
            throw e;
        }
      }

      /** flag to prevent endless save loop, if this object is referenced
        by another object which falls in this transaction. */
    private boolean alreadyInSave = false;
      /**
     * Stores the object in the database.  If the object is new,
     * it inserts it; otherwise an update is performed.  This method
     * is meant to be used as part of a transaction, otherwise use
     * the save() method and the connection details will be handled
     * internally
     *
     * @param con
     * @throws TorqueException
     */
    public void save(Connection con) throws TorqueException
    {
          if (!alreadyInSave)
        {
            alreadyInSave = true;


  
            // If this object has been modified, then save it to the database.
            if (isModified())
            {
                if (isNew())
                {
                    CourseLogPeer.doInsert((CourseLog) this, con);
                    setNew(false);
                }
                else
                {
                    CourseLogPeer.doUpdate((CourseLog) this, con);
                }
            }

                      alreadyInSave = false;
        }
      }


                    
      /**
     * Set the PrimaryKey using ObjectKey.
     *
     * @param  courseLogId ObjectKey
     */
    public void setPrimaryKey(ObjectKey key)
        
    {
            setCourseLogId(((NumberKey) key).intValue());
        }

    /**
     * Set the PrimaryKey using a String.
     *
     * @param key
     */
    public void setPrimaryKey(String key) 
    {
            setCourseLogId(Integer.parseInt(key));
        }

  
    /**
     * returns an id that differentiates this object from others
     * of its class.
     */
    public ObjectKey getPrimaryKey()
    {
          return SimpleKey.keyFor(getCourseLogId());
      }

 

    /**
     * Makes a copy of this object.
     * It creates a new object filling in the simple attributes.
       * It then fills all the association collections and sets the
     * related objects to isNew=true.
       */
      public CourseLog copy() throws TorqueException
    {
        return copyInto(new CourseLog());
    }
  
    protected CourseLog copyInto(CourseLog copyObj) throws TorqueException
    {
          copyObj.setCourseLogId(courseLogId);
          copyObj.setAction(action);
          copyObj.setYear(year);
          copyObj.setMonth(month);
          copyObj.setDay(day);
          copyObj.setHour(hour);
          copyObj.setMinute(minute);
          copyObj.setSecond(second);
          copyObj.setCourseCode(courseCode);
          copyObj.setCourseName(courseName);
          copyObj.setCourseDescription(courseDescription);
          copyObj.setUnits(units);
          copyObj.setOffered(offered);
          copyObj.setSemesterOffered(semesterOffered);
          copyObj.setPrerequisite(prerequisite);
          copyObj.setLectureHoursPerWeek(lectureHoursPerWeek);
          copyObj.setMinimumNumberOfLectureStudents(minimumNumberOfLectureStudents);
          copyObj.setMaximumNumberOfLectureStudents(maximumNumberOfLectureStudents);
          copyObj.setHasLaboratory(hasLaboratory);
          copyObj.setLaboratoryHoursPerWeek(laboratoryHoursPerWeek);
          copyObj.setMinimumNumberOfLaboratoryStudents(minimumNumberOfLaboratoryStudents);
          copyObj.setMaximumNumberOfLaboratoryStudents(maximumNumberOfLaboratoryStudents);
          copyObj.setUnitCode(unitCode);
  
                    copyObj.setCourseLogId(0);
                                                                                                                                                
        
        return copyObj;
    }

    /**
     * returns a peer instance associated with this om.  Since Peer classes
     * are not to have any instance attributes, this method returns the
     * same instance for all member of this class. The method could therefore
     * be static, but this would prevent one from overriding the behavior.
     */
    public CourseLogPeer getPeer()
    {
        return peer;
    }

    public String toString()
    {
        StringBuffer str = new StringBuffer();
        str.append("CourseLog:\n");
        str.append("CourseLogId = ")
           .append(getCourseLogId())
           .append("\n");
        str.append("Action = ")
           .append(getAction())
           .append("\n");
        str.append("Year = ")
           .append(getYear())
           .append("\n");
        str.append("Month = ")
           .append(getMonth())
           .append("\n");
        str.append("Day = ")
           .append(getDay())
           .append("\n");
        str.append("Hour = ")
           .append(getHour())
           .append("\n");
        str.append("Minute = ")
           .append(getMinute())
           .append("\n");
        str.append("Second = ")
           .append(getSecond())
           .append("\n");
        str.append("CourseCode = ")
           .append(getCourseCode())
           .append("\n");
        str.append("CourseName = ")
           .append(getCourseName())
           .append("\n");
        str.append("CourseDescription = ")
           .append(getCourseDescription())
           .append("\n");
        str.append("Units = ")
           .append(getUnits())
           .append("\n");
        str.append("Offered = ")
           .append(getOffered())
           .append("\n");
        str.append("SemesterOffered = ")
           .append(getSemesterOffered())
           .append("\n");
        str.append("Prerequisite = ")
           .append(getPrerequisite())
           .append("\n");
        str.append("LectureHoursPerWeek = ")
           .append(getLectureHoursPerWeek())
           .append("\n");
        str.append("MinimumNumberOfLectureStudents = ")
           .append(getMinimumNumberOfLectureStudents())
           .append("\n");
        str.append("MaximumNumberOfLectureStudents = ")
           .append(getMaximumNumberOfLectureStudents())
           .append("\n");
        str.append("HasLaboratory = ")
           .append(getHasLaboratory())
           .append("\n");
        str.append("LaboratoryHoursPerWeek = ")
           .append(getLaboratoryHoursPerWeek())
           .append("\n");
        str.append("MinimumNumberOfLaboratoryStudents = ")
           .append(getMinimumNumberOfLaboratoryStudents())
           .append("\n");
        str.append("MaximumNumberOfLaboratoryStudents = ")
           .append(getMaximumNumberOfLaboratoryStudents())
           .append("\n");
        str.append("UnitCode = ")
           .append(getUnitCode())
           .append("\n");
        return(str.toString());
    }
}
